package edu.kjxy.day02.t17;

/**
 * 功能:
 * 作者:程序员欧阳子韩
 * 日期:2024/2/1 12:51
 */
public class MyThread extends Thread {
    @Override
    public void run() {
        long beginTime = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < 50000000; i++) {
            Thread.yield();
            count = count + 1;
        }
        long endTime = System.currentTimeMillis();
        System.out.println("用时: " + (endTime - beginTime) + "毫秒！");
    }
}
